starter.controller('orderHadPayController', function($rootScope,$state,$ionicPopup,$timeout,$scope,Page, localStore,$location) {


    var orderId = $state.params.orderId;
    if(orderId == undefined || orderId == "") {
        Page.notice("非法请求!");
        return;
    }

    Page.ajaxPost("app/order/details.do",{orderId : orderId},function(resp){
        $scope.order = resp.data;
        Page.ajaxPost("line/stops.do",{lineId : $scope.order.lineId},function(resp){
            $scope.stopList = resp.data;
        });
    });

    $scope.backGo = function() {
        $state.go("orders");
    };

    $scope.toRefund = function(orderId) {
        $state.go("refund",{orderId : orderId});
    };

    //屏蔽乘车码
    $scope.viewBusCode = function() {
        $state.go("bus_code",{orderId : orderId});
    };

    $scope.viewSingleCode = function(passenger) {
        var tempPassenger = {};
        tempPassenger.orderId = passenger.orderId;
        tempPassenger.onStop = passenger.onStop;
        tempPassenger.passengerName = passenger.passengerName;
        tempPassenger.passengerPhone = passenger.passengerPhone;
        localStore.setObject("singlePassengerCode",tempPassenger);
        $state.go("passenger_code",{passenger : tempPassenger});
    }




});